<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>iFrame测试体验页面无刷新</title>


    <script>
        //所有的值，变量 提前获取
        function go() {
             var url=document.getElementById("url").value
            document.getElementById("iframe1").src=url
        }
    </script>
</head>
<body>

<div>
    <p>请输入地址：</p>
    <p>
        <input type="text" id="url" value="https://blog.kuangstudy.com/index.php/archives/481/">
        <input type="submit" value="提交" onclick="go()">
    </p>
</div>

<div>
    <iframe id="iframe1"  style="width: 100%;height: 500px;"></iframe>
</div>



</body>
</html>